package com.hex.liyue.usermodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.usermodule.bean.MyDownLinesResultBean;

/**
 * Created by $cmm on 2016/6/21.
 * <p/>
 * 我的线下小伙伴的业务类
 */
public class MoreFriendsPresenter {
    private IMoreFriendsView iMoreFriendsView;

    public MoreFriendsPresenter(IMoreFriendsView iMoreFriendsView) {
        this.iMoreFriendsView = iMoreFriendsView;
    }

    public void myFrendis(int page,int page_num) {
        iMoreFriendsView.showLod("加载中...");
        HttpManager.getInstance().myMoreFrendis(UserManager.getUserId(), page, page_num, new ResponseListener<MyDownLinesResultBean>() {
            @Override
            public void onSuccess(MyDownLinesResultBean myDownLinesResultBean) {
                iMoreFriendsView.closeLod();
                iMoreFriendsView.setAdapter(myDownLinesResultBean);
            }

            @Override
            public void onFailure(String responseresult) {
                iMoreFriendsView.showT(responseresult);
                iMoreFriendsView.closeLod();
            }
        });
    }
}
